<?php
require_once(dirname(__FILE__).'/../DataObject/DomainModel.php');
require_once('IDataPager.php');

/**
 * Data pager for SQL Server using specialized stored procedure for paging purposes
 *
 */
class ProcDataPager extends DomainModel implements IDataPager
{
	/**
	 * @var string
	 */
	protected $query;
	/**
	 * Rows per page
	 *
	 * @var int
	 */
	protected $rowsPerPage;
	/**
	 * Number of pages
	 *
	 * Used for internal caching
	 * @var int
	 */
	protected $pageCount;

	/**
	 * @param string $query
	 */
	public function __construct($query)
	{
		$this->query = $query;
	}

	/**
	 * Returns number of pages
	 *
	 * @return int
	 */
	public function getPageCount()
	{
		if (!$this->pageCount)
		{
			//TODO: zapytanie o liczbe stron
		}

		return $this->pageCount;
	}

	/**
	 * Returns specified page
	 *
	 * @param int $pageNo page number
	 */
	public function getPage($pageNo)
	{

	}
}
?>